package com.qcs.sleep.warn.action;

import com.jqing.lib.print.Print;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by chshqiang on 15-7-21.
 * 护眼模式
 */
public abstract class EyeCallWatcher extends RunAppWatcher {

    private List<Integer> levelList;

    public EyeCallWatcher() {
        levelList = new ArrayList<Integer>(0);
        levelList.add(2700);
        levelList.add(7200);
    }

    @Override
    protected boolean isTiming(String packageName) {
        Print.m("this is run " + packageName);
        return true;
    }

    @Override
    protected boolean isMaxLevel(int level) {
        return level == levelList.size();
    }

    @Override
    protected int getLevelDuration(int level) {
        return levelList.get(level);
    }

    @Override
    protected void onWarn(int level) {
        if (0 == level) {
            onYellowWarn();
        } else if (1 == level) {
            onOrangeWarn();
        }
    }

    protected abstract void onYellowWarn();

    protected abstract void onOrangeWarn();

}
